package com.system.service.Impl;

import com.system.dao.TakecourseMapper;
import com.system.entity.*;
import com.system.service.takeCourseService;
import org.omg.CORBA.INTERNAL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.CrossOrigin;

import java.util.List;
import java.util.Map;
@CrossOrigin
@Service
public class takeCourseServiceImpl implements takeCourseService {
    @Autowired
    private TakecourseMapper takeCourseMapper;

    @Override
    public List<SelectCourse> selectCourse(Long stu_id) {
        return takeCourseMapper.selectCourse(stu_id);
    }

    @Override
    public List<Grade> findByStudentId(Long stu_id) {
        return takeCourseMapper.findByStudentId(stu_id);
    }

    @Override
    public List<Grade> findBySemester(Long stu_id, String semester) {
        return takeCourseMapper.findBySemester(stu_id,semester);
    }

    @Override
    public List<Grade> findByCourseType(Long stu_id, String courseType) {
        return takeCourseMapper.findByCourseType(stu_id,courseType);
    }

    @Override
    public List<Grade> findByCourseID(Long stu_id, Integer course_id) {
        return takeCourseMapper.findByCourseID(stu_id,course_id);
    }

    @Override
    public List<Grade> findByCourseName(Long stu_id, String course_name) {
        return takeCourseMapper.findByCourseName(stu_id,course_name);
    }

    @Override
    public List<Grade> findBySemName(Long stu_id, String semester, String course_name) {
        return takeCourseMapper.findBySemName(stu_id,semester,course_name);
    }

    @Override
    public List<Grade> findBySemType(Long stu_id, String semester, String courseType) {
        return takeCourseMapper.findBySemType(stu_id,semester,courseType);
    }

    @Override
    public List<Grade> findBySemId(Long stu_id, String semester, Integer course_id) {
        return takeCourseMapper.findBySemId(stu_id,semester,course_id);
    }

    @Override
    public List<String> findGrade(Integer id){
        return takeCourseMapper.findGrade(id);
    };

    @Override
    public int update(Takecourse takecourse){
        return takeCourseMapper.updateByPrimaryKeySelective(takecourse);
    }

    @Override
    public int deleteByPrimaryKey(TakecourseKey key) {
        return takeCourseMapper.deleteByPrimaryKey(key);
    }

    @Override
    public int insert(Takecourse record) {
        return takeCourseMapper.insert(record);
    }


}
